<!DOCTYPE html>
<html class="x-admin-sm">
  <head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="__ADMIN__/css/font.css">
    <link rel="stylesheet" href="__ADMIN__/css/xadmin.css">
    <script type="text/javascript" src="__ADMIN__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__ADMIN__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__ADMIN__/js/xadmin.js"></script>
    <script type="text/javascript" src="__ADMIN__/js/cookie.js"></script>
    <style>
        .layui-btn+.layui-btn{
            margin-left: 0;
        }
    </style>
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a><cite>{$nav}</cite></a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon layui-icon-refresh-3" style="line-height:30px"></i></a>
    </div>
    <div class="x-body x-admin">
        
      <xblock>
        {if condition="$_SESSION['admin']['group_id'] == 1"}
        <button style="float:left;" class="layui-btn" onclick="x_admin_show('发起考核','OperatorAdd','','600','600')">发起考核</button>
        <button style="float:left;margin-left:20px" class="layui-btn layui-btn-primary" onclick="x_admin_show('考核内容','OperatorContent','','850','700')">考核内容</button>
        {/if}
        <div class="layui-card-body" style="padding-left: 0;float:left;padding-left:20px;padding-top:0;">
          <!--<form class="layui-form layui-col-space5" action="" method="get">-->
          <!--    <div class="layui-inline layui-show-xs-block">-->
          <!--        <input style="width:260px;" type="text" name="keywords" id="search" value="{:input('keywords')}" placeholder="" autocomplete="off" class="layui-input">-->
          <!--    </div>-->
          <!--    <div class="layui-inline layui-show-xs-block">-->
          <!--        <button class="layui-btn" id="search-btn"><i class="layui-icon"></i></button>-->
          <!--    </div>-->
          <!--</form>-->
        </div>
      </xblock>
      <div class="layui-table-body layui-table-main" style="width: 100%;">
      <table class="layui-table layui-form">
        <thead>
          <tr>
            <th>序号</th>
            <th>标题</th>
            <th>截取制作时间范围</th>
            <th>被考核运营</th>
            <th>发起时间</th>
            <th style="text-align: center;">操作</th>
        </thead>
        <tbody>
          {volist name="list" id="v"}
          <tr>
            <td>{$key+1}</td>
            <td>{$v.title}</td>
            <td>{$v.start_time|date="Y-m-d",###}至{$v.end_time|date="Y-m-d",###}</td>
            <td>{$v.operator}</td>
            <td>{$v.add_time|date="Y-m-d",###}</td>
            <td class="td-manage" style="text-align: center;">
                {if condition="$_SESSION['admin']['group_id'] == 1 || $_SESSION['admin']['group_id'] == 2 || $_SESSION['admin']['group_id'] == 5"}
                <a title="参与考核" class="layui-btn layui-btn-normal layui-btn-xs" onclick="x_admin_show('参与考核','OperatorDo?check_id={$v.id}','','1000','800')"  href="javascript:;">参与考核</a>
                {/if}
                {if condition="$_SESSION['admin']['group_id'] == 1 || $_SESSION['admin']['group_id'] == 5"}
                <a title="查看结果" class="layui-btn layui-btn-normal layui-btn-xs" onclick="x_admin_show('考核结果','OperatorStats?check_id={$v.id}','','1000','800')"  href="javascript:;">考核结果</a>
                {/if}
                {if condition="$_SESSION['admin']['group_id'] == 1"}
                <a title="修改" class="layui-btn layui-btn-normal layui-btn-xs" onclick="x_admin_show('修改','OperatorAdd?id={$v.id}','','600','600')"  href="javascript:;">修改</a>
                <a title="删除" class="layui-btn layui-btn-danger layui-btn-xs"  href="javascript:;" lay-filter="del" lay-submit="" lay-id="{$v.id}">删除</a>
                {/if}
            </td>
          </tr>
          {/volist}
        </tbody>
      </table>
    </div>
      <div class="page">
        <div>
          {$list->render()}
        </div>
      </div>
    </div>

    <script>
      layui.use(['form','layer'], function(){
        form = layui.form,
        layer = layui.layer;

        form.on('submit(cancel)', function(data){
            var id = $(this).attr('lay-id');
            layer.confirm('确定要删除？', {icon: 3, title:'删除提醒'}, function(index){
                $.ajax({
                    type:'POST',
                    dataType:'json',
                    data:{id:id},
                    url:"{:url('Check/OperatorDel')}",
                    success:function(obj){
                      layer.msg(obj.msg, {icon: obj.icon,time: 2000},function(){
                        location.reload();
                      });
                    }
                });
              layer.close(index);
            });
            return false;
        });
      });

    </script>
  </body>

</html>